package privilege.controller;

import com.hongfan.common.dto.AuthUserDto;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

/**
 * 获取登录用户信息接口
 *
 * @author 占传森
 */
@RestController
@RequestMapping("/user")
public class UserController {

    /**
     * 根据用户名获取用户信息
     */
    @GetMapping(value = "/loadByUsername")
    @ResponseBody
    public AuthUserDto loadUserByUsername(@RequestParam String username) {
        //获取用户信息
        AuthUserDto userDTO = new AuthUserDto();
        userDTO.setLoginId(username);
        userDTO.setPassword("123456");
        userDTO.setRoles("all");
        return userDTO;
    }

    @GetMapping(value = "/test")
    public ResponseEntity<String> test() {
        return ResponseEntity.ok("成功调用人事系统");
    }


}
